import axios from 'axios'
const instance = axios.create({
    baseURL: ' http://localhost:3000',
    timeout: 3000,
    headers: { 'X-Custom-Header': 'foobar' }
});


instance.interceptors.request.use(function (config) {
    config.headers['token'] = localStorage.getItem('token');
    return config;
}, function (error) {
    return Promise.reject(error);
});


instance.interceptors.response.use(function (response) {
    return response;
}, function (error) {
    return Promise.reject(error);
});
export default instance